/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author Admin
 */
@Embeddable
public class PromotionsPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "promotion_id", nullable = false)
    private int promotionId;
    @Basic(optional = false)
    @Column(name = "media_id", nullable = false)
    private int mediaId;

    public PromotionsPK() {
    }

    public PromotionsPK(int promotionId, int mediaId) {
        this.promotionId = promotionId;
        this.mediaId = mediaId;
    }

    public int getPromotionId() {
        return promotionId;
    }

    public void setPromotionId(int promotionId) {
        this.promotionId = promotionId;
    }

    public int getMediaId() {
        return mediaId;
    }

    public void setMediaId(int mediaId) {
        this.mediaId = mediaId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) promotionId;
        hash += (int) mediaId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PromotionsPK)) {
            return false;
        }
        PromotionsPK other = (PromotionsPK) object;
        if (this.promotionId != other.promotionId) {
            return false;
        }
        if (this.mediaId != other.mediaId) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.PromotionsPK[promotionId=" + promotionId + ", mediaId=" + mediaId + "]";
    }

}
